home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 April: Mac OS SDK / Dev.CD Apr 97 SDK1.toast / Development Kits (Disc 1) / Apple Guide / Authoring / Documentation / Example Source Files Appdx C / Panel Definitions.src < prev    next >
Encoding:
Text File  |  1994-12-09  |  11.0 KB  |  323 lines  |  [TEXT/ttxt]

  1. # *****************PANEL DEFINTIONS********************
  2.  
  3. #you can specify the maximum and minimum height if desired
  4. #by default, Guide Maker uses a maximum height of 250 pixels
  5. <Max Height> 500
  6.  
  7. # *******generic panel that is a placeholder*******
  8. <Define Panel> "PanelGeneric"
  9. Placeholder for information that you supply.
  10. <End Panel>
  11.  
  12. # *******Panels for "How do I use the tools in the toolbar?"*******
  13.  
  14. <Define Panel> "Use Tools"
  15. <Panel Prompt> "introToolsprompts"
  16. The SurfWriter toolbar contains tools that you use to create and manipulate graphics.
  17.  
  18. For an overview of each tool in the toolbar, click Toolbar Tour. For background information on graphics, click Designing Graphics.
  19. #When you specifically place an object you place it relative to the  current pen location. Note 
  20. #that the current pen location is not reset after an object is absolutely placed. The current 
  21. #pen location's horizontal coordinate is the left edge of the current format; the vertical 
  22. #coordinate corresponds to the last object not specifically placed using coordinates. 
  23. # it's (x, y)
  24. #The first button is placed 50 pixels to the right and 20 pixels down of the current pen 
  25. #location; the second button is placed 50 pixels to the right and 80 pixels down of the 
  26. #current pen location.
  27. <Standard Button> "Toolbar Tour", Point(50,20), doNothingEvent()
  28. <Standard Button> "Designing Graphics", Point(50,80), doNothingEvent()
  29. <End Panel>
  30.  
  31. <Define Panel> "Tools 2"
  32. <Panel Prompt> "doThisprompt"
  33. <Format> "Tag"
  34. Do This
  35. <Format> "Body"
  36. Click the Pencil icon in the toolbar.
  37. <End Panel>
  38.  
  39. <Define Panel> "Tools 3"
  40. #panel that shows default features
  41. <Panel Prompt> NONE
  42.  
  43. .
  44.  
  45. <End Panel>
  46.  
  47. <Define Panel> "Tools with Tip"
  48. #panel that shows a Tip button
  49. <Panel Prompt> "doThisprompt"
  50. <Format> "Tag"
  51. Do This
  52. <Format> "Body"
  53. Click the Pen icon in the toolbar.
  54.  
  55. For information about quickly selecting tools, click the Tip button.
  56.  
  57. <Standard Button> "Tip", RIGHT, LaunchNewSequenceNewWindow("Toolbar TipSeq")
  58. <End Panel>
  59.  
  60. <Define Panel> "Toolbar Tip"
  61. <Panel Prompt> "Defn&HuhPrompts"
  62. You can also select tools by using Command-key equivalents. See the Shortcuts Guide for a complete list of these keys.
  63. <End Panel>
  64.  
  65. <Define Panel> "Tools 4"
  66. <Panel Prompt> "YouAreDone2"
  67. <Format> "Tag"
  68. Do This
  69. <Format> "Body"
  70. Close the toolbar.
  71.  
  72. <Standard Button> "Related Topics", CENTER, doNothingEvent()
  73. <End Panel>
  74.  
  75. # *******Panels for "How do I add a word to the dictionary?"*******
  76.  
  77. <Define Panel> "AddWords1"
  78.  <Panel Prompt> "introprompts"
  79. SurfWriter comes with the SurfWriter dictionary, which you can use to check the spelling in your documents.
  80. <End Panel>
  81.  
  82. <Define Panel> "AddWords2"
  83.  <Panel Prompt> "doThisPrompt"
  84. <Coach Mark> "UtilsOpenDictionary"
  85. <Format> "Tag"
  86. Do This
  87. <Format> "Body"
  88. Choose Dictionary from the Utilities menu to open the Dictionary window.
  89. <End Panel>
  90.  
  91. <Define Panel> "AddWords3"
  92.  <Panel Prompt> "doThisprompt"
  93. <Format> "Tag"
  94. Do This
  95. <Format> "Body"
  96. Type your word to add to the dictionary in the New Word text box.
  97. #for SurfWriter, would use: 
  98. #<Coach Mark> "DictionaryNewWord"
  99. #for an application similar to SimpleText:
  100. <Coach Mark> "DictionaryNewWordSimpleText"
  101. <End Panel>
  102.  
  103. <Define Panel> "SWContinuePanel"
  104. #open the dictionary for the user, by sending an Apple event to the
  105. # SurfWriter application requesting it to open the Dictionary window
  106. #Apple Guide sends this event to SurfWriter when it shows this panel
  107. #<On Panel Show> SWOpenDictionary("Dictionary")
  108. <Panel Prompt> "continuePrompt"
  109. Please wait a moment. Apple Guide is assisting you by opening the dictionary.
  110.  
  111. <3D Button> 1070, 1072, Center, GoBack()
  112. #(For illustrative purposes, this example uses SimpleText instead of SurfWriter.)
  113. <On Panel Show> DoAppleScript(":SurfWriter Scripts src:OpenDictionarySimpleText")
  114. <End Panel>
  115.  
  116. <Define Panel> "AddWords4"
  117.  <Panel Prompt> "YouAreDone"
  118. Your word is now part of the SurfWriter dictionary.
  119. <End Panel>
  120.  
  121. #Example of an Oops panel
  122. #(If you use Oops instead of Continue panel in the above sequence)
  123. <Define Panel> "SWOopsPanel"
  124.  <Panel Prompt> NONE
  125. <Format> "Tag"
  126. Oops
  127. <Format> "Body"
  128. You did not open the dictionary. Click OK for instructions (or open the dictionary, then click OK).
  129.  
  130. <Standard Button> "OK", Center, GoBack()
  131. <End Panel>
  132.  
  133.  
  134. # ********************************************************
  135.  
  136. # *******Panels for "How do I create a custom dictionary?"*******
  137.  
  138. #To use styled text in a panel, you can either directly embed the
  139. # style information in the file (if you have the appropriate xtnd translator)
  140. # or you can specify the style information using format commands,
  141. # as shown here.
  142. #introduction panel
  143. <Define Panel> "CreateCustomIntro"
  144. #this panel has an active Huh? button
  145. <Dimmable Button Data> "Huh?", "HuhCompareManualAndAuto"
  146.  <Panel Prompt> "introprompts"
  147. <Format> "PlainText"
  148. You can create a custom dictionary manually or by using
  149. <Format> "UnderlineText"
  150. <Hot Text> "AppleScript", FIRST, LaunchNewSequenceNewWindow("Defns:AppleScript")
  151. AppleScript.
  152. <Format> "PlainTextReset"
  153. For a comparison of these two
  154. <Format> "PlainTextNormal"
  155. methods, click Huh? below.
  156. <End Panel>
  157.  
  158. #Alternatively to using format commands for styled text, you can
  159. # define the panels that contain styled text in a separate file
  160. # and save the file in a format for which you have an xtnd translator,
  161. #to more easily assign style information to the hot text.
  162. #Here's an example (from a file saved in an appropriate format, "Panels with StyleInfo.src") 
  163. #that shows how you can use styled text in a source file.
  164. #<Define Panel> "CreateCustomIntro"
  165. #this panel has an active Huh? button
  166. #<Dimmable Button Data> "Huh?", "HuhCompareManualAndAuto"
  167.  #<Panel Prompt> "introprompts"
  168. #<Format> "Full2"
  169. #Here's the panel text:
  170. #You can create a custom dictionary manually 
  171. #<Hot Text> "AppleScript", FIRST, LaunchNewSequenceNewWindow("Defns:AppleScript")
  172. #or by using AppleScript. For a comparison of these two
  173. #methods, click Huh? below.
  174. #<End Panel>
  175.  
  176. #definition panel for AppleScript
  177. <Define Panel> "HotT AppleScript"
  178.  <Panel Prompt> "Defn&HuhPrompts"
  179. AppleScript is a scripting language that lets you
  180. create sets of written instructions ("scripts")
  181. to automate tasks you perform in an application.
  182. <End Panel>
  183.  
  184. #definition panel for Huh? panel that compares Auto vs Manual methods
  185. <Define Panel> "CompareManualAndAuto"
  186.  <Panel Prompt> "Defn&HuhPrompts"
  187. You can create a custom dictionary by individually entering each word yourself or by using a script that searches an open document for tagged words and places them in the dictionary for you.
  188. <End Panel>
  189.  
  190. #decision panel
  191. <Define Panel> "CreateCustomDecision"
  192.  <Panel Prompt> "standard"
  193. Which do you want to do? Click one:
  194.  
  195. #for <Radio Button> command, provide title of button, default setting, and font
  196. <Radio Button> "manually create a custom dictionary", FALSE, ,,, APPLEGUIDE
  197. <Radio Button> "automatically create a custom dictionary", TRUE, ,,, APPLEGUIDE
  198. <End Panel>
  199.  
  200. #first panel for "manually create a custom dictionary" branch
  201. <Define Panel> "CreateCustomManual1"
  202. <Coach Mark> "UtilsOpenDictionary"
  203.  <Panel Prompt> "doThisPrompt"
  204. <Format> "Tag"
  205. Do This
  206. <Format> "Body"
  207. Choose Dictionary from the Utilities menu to open the Dictionary window.
  208. <End Panel>
  209.  
  210. #Continue panel for "CreateCustomManual1" panel
  211. <Define Panel> "SWContinuePanelCustomManual1"
  212. #open the Dictionary window for the user, by sending an Apple event to the
  213. # SurfWriter application requesting it to perform this action
  214. #[for example, <On Panel Show> SWOpenDictionary("Dictionary") ]
  215. #Apple Guide sends this event to SurfWriter when it shows this panel
  216. #
  217. <Panel Prompt> "continuePrompt"
  218. Please wait a moment. Apple Guide is assisting you by opening the Dictionary window.
  219.  
  220. <3D Button> 1070, 1072, Center, GoBack()
  221. #(For illustrative purposes, this example uses SimpleText instead of SurfWriter.)
  222. <On Panel Show> DoAppleScript(":SurfWriter Scripts src:OpenDictionarySimpleText")
  223. <End Panel>
  224.  
  225. #second panel for "manually create a custom dictionary" branch
  226. <Define Panel> "CreateCustomManual2"
  227.  <Panel Prompt> "doThisPrompt"
  228. <Format> "Tag"
  229. Do This
  230. <Format> "Body"
  231. Click the Create New Custom Dictionary button to create and name a new custom dictionary.
  232. #For SurfWriter, would use:
  233. #<Coach Mark> "CustomDictionary"
  234. <Coach Mark> "CustomDictionaryButtonSimpleText"
  235. <End Panel>
  236.  
  237. #third panel for "manually create a custom dictionary" branch
  238. <Define Panel> "CreateCustomManual3"
  239.  <Panel Prompt> "doThisPrompt"
  240. <Format> "Tag"
  241. Do This
  242. <Format> "Body"
  243. Type your word in the New Word textbox of the Dictionary window. Repeat this step for all your words. For a shortcut, click the Tip button.
  244.  
  245. <Coach Mark> "DictionaryNewWordSimpleText"
  246. <Standard Button> "Tip", RIGHT,  LaunchNewSequenceNewWindow("Tip:CustomDictionary")
  247. <End Panel>
  248.  
  249. #Tip panel for "manually create a custom dictionary" branch
  250. <Define Panel> "TipForCustomDictionary"
  251.  <Panel Prompt> "Defn&HuhPrompts"
  252. To quickly add a word to the dictionary, select the word in your document and then click the Add Word button in the Dictionary window.
  253. <End Panel>
  254.  
  255. #first panel for "automatically create a custom dictionary" branch
  256. <Define Panel> "CreateCustomAuto1"
  257. #this panel has an active Huh? button
  258. <Dimmable Button Data> "Huh?", "HuhScriptsFolder"
  259.  <Panel Prompt> "doThisPrompt"
  260. <Format> "Tag"
  261. Do This
  262. <Format> "Body"
  263. Open the SurfWriter Scripts folder. For information about this folder, click Huh? below.
  264.  
  265. <Standard Button> "Related Topics", RIGHT,  LaunchNewSequenceNewWindow("Related Topics:CustomDictionary")
  266. <End Panel>
  267.  
  268. #Related Topics panel for "automatically create a custom dictionary" branch
  269. <Define Panel> "RelatedTopicsForCustomDictionary"
  270.  <Panel Prompt> "Defn&HuhPrompts"
  271. Also see these topic areas:
  272.                     Scripting
  273.                     Writing excellent prose
  274. <End Panel>
  275.  
  276. #Huh panel for "automatically create a custom dictionary" branch
  277. <Define Panel> "ScriptsFolder"
  278.  <Panel Prompt> "Defn&HuhPrompts"
  279. The SurfWriter Scripts folder contains three scripts: Custom Dictionary, Create Glossary, and Create Bibliography.
  280. <End Panel>
  281.  
  282. #Continue panel for "CreateCustomAuto1" panel
  283. <Define Panel> "SWContinuePanelCustomAuto1"
  284. #Open the SurfWriter Scripts folder for the user, by providing a script that
  285. # performs the action for the user.  
  286. # Use the DoAppleScript event function to run the script.
  287. <Panel Prompt> "continue2Prompt"
  288. Please wait a moment. Apple Guide is assisting you by opening the SurfWriter Scripts folder.
  289.  
  290. <3D Button> 1070, 1072, Center, GoBack()
  291. <On Panel Show> DoAppleScript(":SurfWriter Scripts src:OpenSurfWriterScriptsFolder")
  292. <End Panel>
  293.  
  294. #second panel for "automatically create a custom dictionary" branch
  295. <Define Panel> "CreateCustomAuto2"
  296.  <Panel Prompt> "doThisPrompt"
  297. <Format> "Tag"
  298. Do This
  299. <Format> "Body"
  300. Double-click the Custom Dictionary script.
  301. <Coach Mark> "Custom Dictionary File"
  302. <End Panel>
  303.  
  304. #closure panel for "creating a custom dictionary" 
  305. <Define Panel> "CreateCustomAllDone"
  306.  <Panel Prompt> "standard2"
  307. Your custom dictionary is now created.
  308. <End Panel>
  309.  
  310. # *******panels for Definition panels*******
  311. <Define Panel> "PanelDefineStandardDictionary"
  312. <Panel Prompt> "Defn&HuhPrompts"
  313. Placeholder for information that you supply.
  314. <End Panel>
  315.  
  316. <Define Panel> "PanelDefineCustomDictionary" 
  317. <Panel Prompt> "Defn&HuhPrompts"
  318. Placeholder for information that you supply.
  319. <End Panel>
  320.  
  321.  
  322.  
  323.